﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<#include "/views/ftl/base/manager_include.ftl">
<script type="text/javascript" src="${basePath}js/My97DatePicker/WdatePicker.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户列表</title>
<script type="text/javascript">
$().ready(function() {
	$("#search_button").click(function(){
		$('#select_form').submit();
    });
});
function setReplayShow(id,isShow){
	var msg="确定显示该评论吗？";
	if(isShow==0){
		msg = "确定隐藏该评论吗？";
	}
   if(confirm(msg))
   {
    $.ajax({
		type : 'post',
		url:base+"manager/Replay_setReplayShow",
		dataType : "json",
		data : {id:id,isShow:isShow},
		success : function(data) {
			if(data.code==1){
			    alert("操作成功！");
				$("#pagerForm").submit();
			}
			if(data.code==0){
				alert(data.msg);
			}
		}
	});
	}
}
function deleteReplay(id){
	var msg="确定删除吗？";
   if(confirm(msg))
   {
    $.ajax({
		type : 'post',
		url:base+"manager/Replay_deleteReplay",
		dataType : "json",
		data : {id:id},
		success : function(data) {
			if(data.code==1){
			    alert("操作成功！");
				$("#pagerForm").submit();
			}
			if(data.code==0){
				alert(data.msg);
			}
		}
	});
	}
}
</script>
</head>
<body style="background:#eef3f7;">
<#include "/views/ftl/base/head.ftl">
<div class="Main">
  <div class="dw">
<#include "/views/ftl/base/menu.ftl">
<#function a><#return "回帖列表_List"></#function> 
<!--右边内容-->
<div class="Rightbox fl">
    <!--导航-->
    <div class="Bread_crbs clear">
      <div class="Bread_crbs_img fl"></div>
      <div class="Bread_crbs_text fl">
      	<a href="javascript:void(0);"><span>论坛管理</span></a>
      	<span class="fnt_famy">></span>
      	<a href="javascript:void(0);"><span>回帖列表</span></a>
      </div>
    </div>
    <!--搜索框修改-->
    <form id="select_form" name="select_form" action="${basePath}manager/Replay_replayList" method="post">
	    <div class="searchBox fl">
	        <span>用户</span><input type="text" name="userId" value="${(userId)!''}" style="width:100px;" />
	        <span>置顶</span>
	        <select name="isShow">
	        	<option value="-1" <#if (isShow==-1)>selected</#if>>全部</option>
	        	<option value="0" <#if (isShow==0)>selected</#if>>否</option>
	        	<option value="1" <#if (isShow==1)>selected</#if>>是</option>
	        </select>
	        <span>回帖时间</span><input type="text" name="startDate" style="width:100px;" value="${(startDate)!''}" readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
	    </div>
    </form>
	    <a href="javascript:void(0);" id="search_button" class="search_btn fl"><span>搜索</span></a>
    <div class="clear"></div>
    <!--表格列表-->
    <div class="Table">
      <table id="table" cellpadding="0" cellspacing="1">
        <tbody>
          <tr id="gl">
            <td>回帖人</td>
            <td>内容</td>
            <td>时间</td>
            <td>状态</td>
            <td>帖子</td>
            <td>流量</td>
            <td>操作</td>
          </tr>
         <#if (pager.list??)> 
         <#if ((pager.list?size)>0)>
          <#list pager.list as bean>
          <tr>
            <td>${(bean.user.nick)!''}</td>
            <td style="text-align:left;padding-left:5px;"><#if bean.reContent??><#if (bean.reContent?length>=25)>${bean.reContent?substring(0,25)}...<#else>${bean.reContent}</#if></#if></td>
            <td>${(bean.publictDate)!''}</td>
            <td><#if bean.isShow==0>隐藏</#if><#if bean.isShow==1>显示</#if></td>
            <td>${bean.post.id?c}</td>
            <td>${(bean.supportView)!''}</td>
            <td class="tbl_btn">
              <a href="${basePath}manager/Post_showPost?id=${bean.id?c}"><span id="editor">查看</span></a>
              <#if bean.isShow==0>
              	<a href="javascript:setReplayShow(${bean.id?c},1);"><span id="green">显示</span></a>
              </#if>
              <#if bean.isShow==1>
              	<a href="javascript:setReplayShow(${bean.id?c},0);"><span id="yellow">隐藏</span></a>
              </#if>
              <a href="javascript:deleteReplay(${bean.id?c});"><span id="delete">删除</span></a>
            </td>
          </tr>
          </#list >
          </#if>
          </#if>
        </tbody>
      </table>
    </div>
    <!--翻页按钮-->
  	<#import "../base/pager.ftl" as p>
   	<@p.pager pager = pager baseUrl = "manager/Replay_replayList" parameterMap={"userId":(userId?c),"isShow":isShow,"startDate":(startDate)!''} />
	</div>
  </div>
</div>
</body>
</html>

